﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TAXILISM.HelperClasses
{
    public class FBWallNewsPost
    {
        public string TheCaption { get; set; }
        public string TheDescription { get; set; }
        public string TheLink { get; set; }
        public string TheMessage { get; set; }
        public string TheName { get; set; }
        public string ThePictureLink { get; set; }

        
        public FBWallNewsPost() { }
        public FBWallNewsPost(bool bFillDefaults)
        {
            if (bFillDefaults)
            {
                DateTime time = new DateTime();
                time = DateTime.Now;
                
                //TheCaption = "TestShowNews";
                //TheDescription = "Testdescription";
                //TheLink = "http://www.facebook.com/apps/application.php?id=119684911454385";
                //TheMessage = "Message sented by PTTOil Application from Window Phone 7";
                //TheName = "Taxilism";
                //ThePictureLink = "https://lh6.googleusercontent.com/-jIIqe3IceFg/TmzMZA8VK2I/AAAAAAAAAAw/BV4gytw4zso/taxilism_facebookApplogo.png";
                //TheCaption = time.ToString();
            }
        }
        

        public string GetPostParameters(string strAccessToken, string kortor, string TaxiColor)
        {
            try
            {
                if (!kortor.Equals(""))
                    TheMessage = "กำลังอยู่บนรถแท๊กซี่ " + TaxiColor + " : " + kortor;
                else
                    TheMessage = "กำลังอยู่บนรถแท๊กซี่ " + TaxiColor;

                string strRet = "access_token=" + strAccessToken;
                //if (!string.IsNullOrEmpty(kortor))
                //{
                //    strRet += "&caption="+"เลขที่ทะเบียน : " + HttpUtility.UrlEncode(kortor);
                //}
                //if (!string.IsNullOrEmpty(TaxiColor))
                //{
                //    strRet += "&description=" +"Color : " + HttpUtility.UrlEncode(TaxiColor);
                //}
                if (!string.IsNullOrEmpty(TheLink))
                {
                    strRet += "&link=" + HttpUtility.UrlEncode(TheLink);
                }
                if (!string.IsNullOrEmpty(TheMessage))
                {
                    strRet += "&message=" + HttpUtility.UrlEncode(TheMessage);
                }
                if (!string.IsNullOrEmpty(TheName))
                {
                    strRet += "&name=" + HttpUtility.UrlEncode(TheName);
                }
                if (!string.IsNullOrEmpty(ThePictureLink))
                {
                    strRet += "&picture=" + HttpUtility.UrlEncode(ThePictureLink);
                }
                return (strRet);
            }
            catch { return (""); }
        }
    }
}
